<template>
	<text class="s_icon_check" @click="GoClick" 
	:class="{'s_icon_check_has_txt':txt,'s_icon_check_has_none':type=='none','s_icon_check_has_border':type=='border'}"
	:style="{'--color':color,'--size':n_size,'--width':n_width,'--height':n_height,'--border':n_borderw}">
		{{txt}}
	</text>
</template>

<script>
export default {
	name:"s-icon-check",
	props: {
		type: { type: String,default: 'border' },//custom(默认值，主色调赋值背景),none(灰色),border(主色调赋值边框和文字)
		size: { type: [Number,String],default: 40 },//圆形大小尺寸，单位rpx
		txt: { type: String,default: '' },// 用文字代替对号
		color: { type: String,default: '#000' },// 主色调颜色
	},
	computed: {
		num_px() { return uni.upx2px(parseInt(this.size) || 40); },
		n_size() { return this.num_px +'px'; },
		n_width() { return this.num_px*0.0625+'px'; },
		n_height() { return this.num_px*0.075+'px'; },
		n_borderw() { return this.num_px*0.06+'px'; },
	},
	methods: {
		GoClick(){
			this.$emit("click");
		}
	}
};
</script>

<style lang="scss">
@import "../../libs/style/conmon.scss";

</style>
